package com.tsll.controller;

import com.tsll.entity.VerifyApplication;
import com.tsll.service.VerifyApplicationService;
import com.tsll.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Tian
 * @version: 1.0
 * @since: 1.0
 * @date: 2024/3/27/20:00
 */
@RestController
@RequestMapping("/verifyApplication")
public class VerifyApplicationController {
        @Autowired
        VerifyApplicationService verifyApplicationServiceImpl;

        /**
         * 查询校验申请信息
         * @param current
         * @param pageSize
         * @return
         */
        @RequestMapping("/selectAll/{current}/{pageSize}")
        public Result selectAll(@PathVariable Integer current, @PathVariable Integer pageSize){
            return verifyApplicationServiceImpl.selectAll(current,pageSize);
        }

        /**
         * 根据id修改审核状态
         * @param id
         * @return
         */
        @RequestMapping("/updateById/{id}")
        public Result updateById(@PathVariable Integer id){
                return new Result(200,"修改成功",verifyApplicationServiceImpl.updateById(id));
        }

        /**
         * 根据id修改驳回信息
         */
        @RequestMapping("/updateRejectionById")
        public Result updateRejectionById(@RequestBody VerifyApplication verifyApplication){
                return verifyApplicationServiceImpl.updateRejectionById(verifyApplication.getRejection(), verifyApplication.getId());
        }


        /**
         * 查询
         * @param current
         * @param pageSize
         * @return
         */
        @RequestMapping("/selectAllInfo/{current}/{pageSize}")
        public Result selectAllInfo(@PathVariable Integer current,@PathVariable Integer pageSize){
                return verifyApplicationServiceImpl.selectAllInfo(current,pageSize);
        }



}
